#ifndef _SOLVER_H_
#define _SOLVER_H_
#include "timeDiscr.h"
// 在 solver 里协调各种调用  一个物理时间步
#include <string>
#include <fstream>
class Solver
{
private:
  const VarArray<Coord_t, 2, 0> &coord;
  // const std::vector<BoundDescrp_t> &Bdescrp;
  const real_t resReduct,
      convTol,
      refMomentX,
      refMomentY,
      //  Reference length for moment non-dimensional coefficients
      refLength;

  const std::string convgFname, flowSolFname, surfFname;
  const int extIter, wrtSolFreq, wrtConvFreq;
  TimeDiscr &timeDiscrete;
  const Fluid &flow;
  const SpaceDiscr &spaceDiscrete;
  std::ofstream convFile;

public:
  Solver() = delete;
  Solver(const Solver &src) = delete;
  Solver(Solver &&src) = delete;
  Solver &operator=(const Solver &src) = delete;
  Solver &operator=(Solver &&src) = delete;
  ~Solver() = default;

  Solver(const Config &cfg, TimeDiscr &timeAdvance, const Fluid &flows,
         const VarArray<Coord_t, 2, 0> &coord,
         const SpaceDiscr &spaceDiscrIn);
  void FlowSolverEuler(void);
  void FlowSolverNS(void);

  void WriteFlowASSCIIBlock(int iter);
  void WriteFlowASSCIIPoint(int iter);
  void WriteSurfaceASSCII(int iter);
  // void WriteConvHistory(void)
};

#endif